﻿{% extends 'base_fq.html' %}
{% load static %}


{% block title %}
    主页
{% endblock %}

{% block content %}

    <section class="hero-slider bg-grey">
        <div class="container">
            <div class="main-hero-slider owl-carousel owl-theme">

                <div class="item">
                    <div class="single-slider item">
                        <div class="row">
                            <div class="col-lg-7 col-md-8 my-auto">
                                <div class="text-inner">
                                    <div class="hero-text">
                                        <h1><span>UP TO 50% OFF </span>For Your First Buy</h1>
                                        <p>There are many variations of passages of lorem ipsum <br> available but the
                                            majority have suffered alteration in <br> some form by injected humour.</p>
                                        <div class="button">
                                            <a href="#" class="btn">Shop Now!</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-5 col-md-4 my-auto">
                                <img src="{% static 'temp_shop/assets/img/slider/slider-2.png' %}" class="w-100" alt="">
                            </div>
                        </div>
                    </div>
                </div>


                <div class="item">
                    <div class="single-slider item">
                        <div class="row">
                            <div class="col-lg-7 col-md-8 my-auto">
                                <div class="text-inner">
                                    <div class="hero-text">
                                        <h1><span>UP TO 50% OFF </span>For Your First Buy</h1>
                                        <p>There are many variations of passages of lorem ipsum <br> available but the
                                            majority have suffered alteration in <br> some form by injected humour.</p>
                                        <div class="button">
                                            <a href="#" class="btn">Shop Now!</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-5 col-md-4 my-auto">
                                <img src="{% static 'temp_shop/assets/img/slider/slider-2.png' %}" class="w-100" alt="">
                            </div>
                        </div>
                    </div>
                </div>


                <div class="item">
                    <div class="single-slider item">
                        <div class="row">
                            <div class="col-lg-7 col-md-8  my-auto">
                                <div class="text-inner">
                                    <div class="hero-text">
                                        <h1><span>UP TO 50% OFF </span>For Your First Buy</h1>
                                        <p>There are many variations of passages of lorem ipsum <br> available but the
                                            majority have suffered alteration in <br> some form by injected humour.</p>
                                        <div class="button">
                                            <a href="#" class="btn">Shop Now!</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-5 col-md-4 my-auto">
                                <img src="{% static 'temp_shop/assets/img/slider/slider-2.png' %}" class="w-100" alt="">
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </section>

    <div class="product-area section">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="section-title d-flex justify-content-between align-center">
                        <div class="d-flex section-title-left">
                            <i class="flaticon-tags"></i>
                            <h2>任务信息</h2>
                        </div>
                        <div class="section-title-right">
                            <a href="{% url 'task_market:all_grid' %}">View More <i class="far fa-long-arrow-right"></i></a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="product-slider owl-carousel owl-theme">
                {% for task in tasks %}
                    <div class="item">
                        <div class="single-product">
                            <div class="product-img">
                                <a href="{% url 'task_market:details' id=task.id %}">
                                    <img class="product-img" src="{% static 'temp_shop/assets/img/slider/slider.png' %}"
                                         alt="#">
                                    <span class="new">{{ task.id }}</span>
                                </a>
                                <div class="button-head">
                                    <div class="product-action">
                                        <a data-bs-toggle="modal" data-bs-target="#staticBackdrop{{ task.id }}"
                                           href="#"><i
                                                class="far fa-eye"></i><span>Quick Shop</span></a>
                                        <a href="#"><i class="far fa-heart"></i><span>Add to Wishlist</span></a>
                                        <a href="#"><i class="far fa-exchange"></i><span>Add to Compare</span></a>
                                    </div>
                                </div>
                            </div>
                            <div class="product-content">
                                <h3><a href="{% url 'task_market:details' id=task.id %}">{{ task.task_name }}</a></h3>
                                <div class="product-rate">
                                    <i class="fas fa-star"></i>
                                    <i class="fas fa-star"></i>
                                    <i class="fas fa-star"></i>
                                    <i class="far fa-star"></i>
                                    <i class="far fa-star"></i>
                                </div>
                                <div class="d-flex justify-content-between">
                                    <div class="product-price">
                                        <span>{{ task.task_salary }}元/条</span>
                                    </div>
                                    <button class="product-cart-btn" type="button"><i class="fal fa-shopping-cart"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>

{% endblock %}

{% block view %}

    {% for task in tasks %}
        <div class="modal" id="staticBackdrop{{ task.id }}" data-bs-backdrop="static" data-bs-keyboard="false"
             tabindex="-1" aria-labelledby="staticBackdrop" aria-hidden="true">
            <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
                <div class="modal-content">
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <img src="{% static 'temp_shop/assets/img/products/p1.png' %}" alt="#">
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <div class="quickview-content">
                                    <h2>{{ task.task_name }}</h2>
                                    <div class="d-flex mb-3">
                                        <span>Brand:</span>
                                        <b>Xbeats</b>
                                    </div>
                                    <div class="d-flex mb-3">
                                        <span>Category:</span>
                                        <b>Headphones</b>
                                    </div>
                                    <div class="d-flex mb-3">
                                        <span>Tated:</span>
                                        <div class="quickview-ratting-review">
                                            <div class="quickview-ratting-wrap">
                                                <div class="quickview-ratting">
                                                    <i class="fa fa-star"></i>
                                                    <i class="fa fa-star"></i>
                                                    <i class="fa fa-star"></i>
                                                    <i class="fa fa-star"></i>
                                                    <i class="fal fa-star"></i>
                                                    <a href="#"> (50)</a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <h3>{{ task.task_salary }}元/条</h3>
                                    <div class="quickview-stock">
                                        <span><i class="fa fa-check-circle-o"></i> Stock Available</span>
                                    </div>
                                    <div class="add-to-cart">
                                        <a href="{% url 'task_market:details' id=task.id %}" class="btn">详情信息</a>
                                    </div>
                                    <div class="default-social">
                                        <h4 class="share-now">Share:</h4>
                                        <ul>
                                            <li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
                                            <li><a href="#"><i class="fab fa-twitter"></i></a></li>
                                            <li><a href="#"><i class="fab fa-pinterest-p"></i></a></li>
                                            <li><a href="#"><i class="fab fa-instagram"></i></a></li>
                                            <li><a href="#"><i class="fab fa-linkedin-in"></i></a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endfor %}

{% endblock %}